In a computer system that includes a host central processing unit (CPU) and a main storage device such as a disk drive storage system, data fragmentation is a problem that can affect system performance. Data fragmentation can occur in a disk drive storage system that includes a single large disk drive providing main storage for the CPU, or a storage system that includes a plurality of smaller disk drives arranged to perform the same function. An example of the latter type of disk drive storage system is the SYMMETRIX line of disk arrays, available from EMC Corporation, Hopkinton Mass. Fragmentation results from the fact that all data in a logical file stored in a storage device is not necessarily written to the device at the same time, and therefore, data within a single logical file can be stored on different physical areas of the device.
FIG. 1 illustrates a storage device 1 including a plurality of schematically represented physical areas 2-8. When a logical file LF1 (represented by cross-hatching) is first written to the storage device 1, it may be written to the first available physical space, such as physical space 2. As additional logical files are written to the storage device, they are assigned to the next available physical space on the device, which begins to fill up as represented by the dotted areas in FIG. 1. Thus, if additional information is later added to logical file LF1, no space is available for that information in physical area 2, so the additional information is written to the storage device 1 at a different physical location from the portion of LF1 initially written. In the example shown in FIG. 1, an addition to logical file LF1 is written to a portion of physical area 5 on the storage device. It is such separation of a single logical file into two or more physical areas on a storage device that is known as data fragmentation.
The fragmentation of data on a storage device can negatively impact the performance of the system because separate input/output (I/O) operations are required to read different physical locations on the storage device. Thus, referring to the simple example of FIG. 1, due to the fragmentation of the logical file LF1, two I/O operations are required to read the logical file, thereby increasing the access time over that which would be required if the logical file LF1 was stored on a contiguous physical portion of the disk drive and could be read using a single I/O operation. It should be recognized that in practical applications, the fragmentation problem is far worse than that depicted in the simple example of FIG. 1, such that logical files can be fragmented into a large number of different physical sections of a storage device, thereby significantly decreasing the performance of the storage system.
Data fragmentation is a potential problem in all systems wherein data is stored to a disk or other storage device. However, due to the manner in which some systems control the writing of data to a main storage device, the fragmentation problem is magnified. An example of such a system is the AS/400 sold by International Business Machines (IBM). The AS/400 is a host CPU that is typically connected to a disk drive storage system that includes a plurality of disk drives that together provide main storage for the system. In the AS/400, when a large logical file is written to the storage system, the file is striped across the plurality of disks, i.e., the logical file is broken up into a plurality of smaller segments that are respectively written to the plurality of disks. Striping is performed so that when the logical file is read, the multiple disk drives can process portions of the read for the large volume simultaneously, with expectations of improved performance.
The striping of logical files across multiple disks aggravates the data fragmentation problem. In particular, by splitting each logical file up into smaller segments, each disk fills with smaller segments than if the data was not striped, which causes fragmentation problems to develop more rapidly. Furthermore, unlike many other systems, the operating system in the AS/400 controls the allocation of logical files to the physical areas on the disk drives, and does not give any flexibility or control over this allocation to the application software or any level of software below the operating system level. Therefore, the allocation of the logical files cannot be controlled to minimize data fragmentation.
Many computer systems provide some facility for processing the data stored on a disk drive to reduce data fragmentation after it has occurred. In the AS/400, this facility is called a "reload". The reloading of a disk drive or group of disks involves two steps. Initially, a full system back-up is run on the storage device system, such that all of the data on the storage device is backed up to a temporary storage medium such as a tape or another disk drive. This can be done using standard AS/400 resources, but requires that the system be rebooted and that all other activity on the system be halted. This takes approximately 8-20 hours for a storage device of approximately 400 gigabytes. After the back-up is complete, the data is reloaded onto the system using reload software provided with the AS/400. The reload process reallocates the logical files written back to the disk drive so that each logical file is written to a contiguous physical section of the disk drive, or if spread across multiple disks, occupies contiguous physical space within each. The reload process can take approximately 10-30 hours for a storage device of approximately 400 gigabytes. When the reload software is running, the system is not available for normal operation.
Although most computer systems include a facility (such as the AS/400 reload) for defragmenting data on a storage device, such facilities are infrequently used by customers because they require that the system be brought off-line and may keep the system down for approximately 18-50 hours or more. This is particularly disadvantageous for business applications wherein the computer system is expected to essentially manage itself without significant control by the customer, and without requiring that work be halted to run system management operations. As a result, customers will often defragment their storage system only very infrequently, resulting in reduced performance of the storage system. Some systems do provide a reload facility that works in a background mode, but this process typically takes months, making it impractical for most users.
In view of the foregoing, it is an object of the present invention to provide an improved method and apparatus for reloading data on a storage device, thereby improving the defragmentation process.